package com.ictology.mei;

import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import android.content.Intent;

public class EIActivity_fragment extends Fragment {

    public static EIActivity_fragment newInstance() {
        return new EIActivity_fragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.activity_eifragment, container, false);
        ImageButton ei_book_imageBtn_1 = (ImageButton) view.findViewById(R.id.ei_book_imageBtn_1);
        ImageButton ei_book_imageBtn_2 = (ImageButton) view.findViewById(R.id.ei_book_imageBtn_2);
        ImageButton ei_book_imageBtn_3 = (ImageButton) view.findViewById(R.id.ei_book_imageBtn_3);

        ei_book_imageBtn_1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent pushViewIntent = new Intent(getActivity(), EI_book.class);
                pushViewIntent.putExtra("name", "2016年度首次");
                pushViewIntent.putExtra("pdf", "2016S1.pdf");
                getActivity().startActivity(pushViewIntent);
            }
        });

        ei_book_imageBtn_2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent pushViewIntent = new Intent(getActivity(), EI_book.class);
                pushViewIntent.putExtra("name", "2016年度第二次");
                pushViewIntent.putExtra("pdf", "2016S2.pdf");
                getActivity().startActivity(pushViewIntent);
            }
        });

        ei_book_imageBtn_3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent pushViewIntent = new Intent(getActivity(), EI_book.class);
                pushViewIntent.putExtra("name", "2016年度第三次");
                pushViewIntent.putExtra("pdf", "2016S3.pdf");
                getActivity().startActivity(pushViewIntent);
            }
        });


        return view;
    }

    @Override
    public void onStart() {
        super.onStart();
        TextView title=(TextView)getActivity().findViewById(getResources().getIdentifier("action_bar_title", "id", getActivity().getPackageName()));
        title.setText("創業指數");
    }

}
